import java.math.BigDecimal;
import java.util.Calendar;
import java.util.List;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jeecg.modules.system.service.SysPermissionService;
import org.jeecg.modules.system.service.SysUserRoleService;
import org.jeecg.tools.MyTestUtil;
import org.springframework.context.ApplicationContext;
import sqlserver.context.Connect;

public class Stringtest {

	public static void main(String[] args){
		String str = "我的名字（测试）";

		final String REGEX1 = "我的名字2";

		//String line = "ISERT sys_announcement (id, titile, msg_content, start_time, end_time, sender, priority, msg_category, msg_type, send_status, send_time, cancel_time, del_flag, bus_type, bus_id, open_type, open_page, create_by, create_time, update_by, update_time, user_ids) VALUES ('1b714f8ebc3cc33f8b4f906103b6a18d', '5467567', ULL, ULL, ULL, 'admin', ULL, '2', ULL, '1', CAST(0x0700275E426A7B3F0B AS DateTime2), ULL, '0', ULL, ULL, ULL, ULL, 'admin', CAST(0x07007B15C4915B3F0B AS DateTime2), 'admin', CAST(0x07005BB367935B3F0B AS DateTime2), ULL)";

		String line= "CAST(0x07007B15C4915B3F0B AS DateTime)";
		String line2="CAST(0x0700275E426A7B3F0B AS DateTime2)";

		String reg = ".*((?i)CAST\\(0x[0-9-a-f-A-F]+ AS DateTime2\\)).*";

		Pattern pattern=Pattern.compile(reg);

		Matcher matcher=pattern.matcher(line2);

		System.out.println(matcher.find());


		Random r = new Random();
		StringBuilder rs = new StringBuilder();
		for (int i = 0; i < 19; i++) {
		rs.append(r.nextInt(10));
		 }
		System.out.print(rs);
		//MyTestUtil.print(bCount);

		ApplicationContext applicationContext=new Connect().get();

		//SysPermissionService sysPermissionService= (SysPermissionService) applicationContext.getBean("sysPermission");

		SysUserRoleService sysUserRoleService= (SysUserRoleService) applicationContext.getBean("sysUserRole");

		List list=sysUserRoleService.getRoleByUserName("admin");

		MyTestUtil.print(list);

	}

}
